var t = require;
var e = module;
var o = exports;
var a,
    i =
        (this && this.__extends) ||
        ((a = function (t, e) {
            return (a =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                })(t, e);
        }),
        function (t, e) {
            a(t, e);
            function o() {
                this.constructor = t;
            }
            t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o());
        }),
    n =
        (this && this.__decorate) ||
        function (t, e, o, a) {
            var i,
                n = arguments.length,
                r = n < 3 ? e : null === a ? (a = Object.getOwnPropertyDescriptor(e, o)) : a;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, a);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (i = t[s]) && (r = (n < 3 ? i(r) : n > 3 ? i(e, o, r) : i(e, o)) || r);
            return n > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("UIBase"),
    s = t("UIConfig"),
    c = t("UIManager"),
    p = cc._decorator,
    l = p.ccclass,
    d =
        (p.property,
        p.menu,
        (function (t) {
            i(e, t);
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                e.canClose = !1;
                return e;
            }
            e.prototype.onShowEnd = function () {
                var t = this,
                    e = this.ui_data.list,
                    o = this.ui_data.merageId;
                this.scheduleOnce(function () {
                    if (2 == e.length) {
                        t._animal2.$MergeBoxList.setMergeData(e, o);
                        t._animal3.$Animation.stop();
                        t._animal2.$Animation.play("mergeBox2");
                    } else if (3 == e.length) {
                        t._animal3.$MergeBoxList.setMergeData(e, o);
                        t._animal3.$Animation.stop();
                        t._animal3.$Animation.play("mergeBox3");
                    }
                });
                this._parentNode2.opacity = 0;
                this.scheduleOnce(function () {
                    t._parentNode2.opacity = 255;
                    t.canClose = !0;
                }, 2);
                var a = CacheDataManager.getCostumeup(),
                    i = CacheDataManager.getCostume(),
                    n = a[o],
                    r = i[n.costume_id],
                    s = n.quality;
                this._merageName.$Label.string = CacheDataManager.getEquipName(o);
                SpriteView.setQualityName(s, this._rate.$Label);
                SpriteView.setQualityBgLineColor(s, this._rate);
                var c = CacheDataManager.getQualityLevelIndexAdd(s, "1");
                this._addValue.$Label.string = "+" + c + "%";
                SpriteView.setQualityBgLineColor(s, this._newTip);
                for (var p = 0; p < 4; p++) {
                    var l = "unlock" + (p + 1);
                    if (n.quality == r[l]) {
                        var d = "value" + (p + 1) + "_desc",
                            u = "value" + (p + 1);
                        this._newItemBgCom.$BgItemColorCom.setColor(n.quality);
                        this._newTip.$Label.string = CacheDataManager.getLang(r[d]);
                        this._newTip2.$Label.string = "+" + this.getLastValue(r[u]) + "%";
                        var h = "";
                        if (3 == p) {
                            var f = r[u];
                            h =
                                "" +
                                CacheDataManager.getQualityLevelAdd(n.quality, 1) * (this.getLastValue(f + "") / 100);
                        }
                        this._newTip2.$Label.string = "" != h ? h + "%" : "+" + this.getLastValue(r[u]) + "%";
                        break;
                    }
                }
            };
            e.prototype.getLastValue = function (t) {
                var e = t.split("_");
                return parseFloat((e[e.length - 1] || 0) + "");
            };
            e.prototype._onCloseBtnTouchEnd = function () {
                if (this.canClose) {
                    var t = this.ui_data.addCost || 0;
                    t > 0 && c.default.open(s.UIID.UIResetLevelTip, {count: t, overCb: function () {}});
                    this.closeUI();
                }
            };
            e.prototype.onCloseStart = function () {};
            return n([l], e);
        })(r.default));
o.default = d;
